﻿using System;
using System.Collections.Generic;
using System.Text;
using SyncCommon;

namespace HefaSyncTool.SyncManager
{
    public class ISyncFactory
    {
        public static ISyncHouse Create(long WebSiteID,string username, string password)
        {
            ISyncHouse syncHandler = null;
            try
            {
                SDWebsite website = SharedVal.WebSites[WebSiteID];
                syncHandler = (ISyncHouse)Activator.CreateInstance(Type.GetType(website.RegsiterClass), username, password);
                syncHandler.WebSiteID = WebSiteID;
            }
            catch (Exception exp)
            {
                LogCenter.Log(exp);
            }
            return syncHandler;
        }
    }
}
